#pragma once

class CBase;
class CHero;
class CUnit;
class CStructure;
class CResource;
class CArrow;
class CTile;

enum eMsgTypes { MSG_NULL = 0, SPAWN_UNIT, SPAWN_UNIT_MENU, DESTROY_UNIT, SPAWN_PUNCHING_BAG,
DESTROY_ARROW, DAMAGE_TARGET, CREATE_TILE, ADD_LEVEL_COLLISION, DELETE_UNIT, MSG_MAX };

class CMessage
{
private:
	int	m_nMsgID;

public:
	CMessage(int MsgID) { m_nMsgID = MsgID;}

	virtual ~CMessage(void) {}

	int GetMsgID(void)	{ return m_nMsgID; }
};

class SpawnUnit : public CMessage
{
	int m_nType;
public:
	SpawnUnit(int nType);
	~SpawnUnit();
	int Type() const { return m_nType; }
	void Type(int val) { m_nType = val; }
};

class SpawnUnitMenu : public CMessage
{
public:
	SpawnUnitMenu() : CMessage(SPAWN_UNIT_MENU) {}
};

class SpawnPunchingBag : public CMessage
{
public:
	SpawnPunchingBag() : CMessage(SPAWN_PUNCHING_BAG) {}
};

class DestroyUnitMessage : public CMessage
{
	CUnit* m_pUnit;
public:
	DestroyUnitMessage(CUnit* pUnit);
	~DestroyUnitMessage();
	CUnit* GetUnit() {return m_pUnit;}
};

class DeleteUnitMessage : public CMessage
{
	CUnit* m_pUnit;
public:
	DeleteUnitMessage(CUnit* pUnit);
	~DeleteUnitMessage();
	CUnit* GetUnit() {return m_pUnit;}
};

class DamageMessage : public CMessage
{
	int m_nDmg;
	CUnit* m_pTarget;
public:
	DamageMessage(int nDmg, CUnit* pTarget);
	~DamageMessage();
	int GetDmg() {return m_nDmg;}
	CUnit* GetTarget() {return m_pTarget;}
};

class AddLevelCollisionMessage : public CMessage
{
	int m_nType;
	int m_nPosX;
	int m_nPosY;
	int m_nWidth;
	int m_nHeight;
public:
	AddLevelCollisionMessage(int nType, int nPosX, int nPosY, int nWidth, int nHeight);
	~AddLevelCollisionMessage() {}
	int Type() const { return m_nType; }
	int PosX() const { return m_nPosX; }
	int PosY() const { return m_nPosY; }
	int Width() const { return m_nWidth; }
	int Height() const { return m_nHeight; }
};

class CreateTileMessage : public CMessage
{
	int m_nPosX;
	int m_nPosY;
	CTile* m_pTile;
public:
	CreateTileMessage(CTile* pDest, int nPosX, int nPosY);
	~CreateTileMessage();
	int PosX() const { return m_nPosX; }
	int PosY() const { return m_nPosY; }
	CTile* Tile() const { return m_pTile; }
	void Tile(CTile* val) { m_pTile = val; }
};